using UnityEngine;

namespace CheckApplication{
    public class Check : MonoBehaviour
    {
        public FirstController sceneController;

        void Start()
        {
            sceneController = (FirstController)SSDirect.getInstance().CurrentSceneController;
            sceneController.gameStatusManager=this;
        }

        public int CheckGame(){
            //0-游戏1继续；1-游戏成功；-1-游戏失败
            int[] boatRole=sceneController.boat.getRoleNum();
            int[] startRole=sceneController.startLand.getRoleNum();
            int[] endRole=sceneController.endLand.getRoleNum();

            if(endRole[0]+endRole[1]==6) return 1;

            if(sceneController.boat.getBoatSign()==1){
                startRole[0]+=boatRole[0];
                startRole[1]+=boatRole[1];
            }else{
                endRole[0]+=boatRole[0];
                endRole[1]+=boatRole[1];
            }

            if((endRole[0]>0 && endRole[1]>endRole[0]) || (startRole[0]>0 && startRole[1]>startRole[0]))
                return -1;
            return 0;
        }
    }
}

